 <!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>登录</title>
        <link rel="stylesheet" href="/statics/style/common.css">
        <link rel="stylesheet" href="/statics/style/style.css">
    </head>
        <?php if (Yii::app()->user->hasFlash('alertmsg')): ?>
            <?php $msg = Yii::app()->user->getFlash('alertmsg'); ?>
            <?php if ($msg['type'] == 'success'): ?>
            <?php $type = 'success'; ?>
            <?php elseif ($msg['type'] == 'error'): ?>
            <?php $type = 'danger'; ?>

            <?php elseif ($msg['type'] == 'info'): ?>
            <?php $type = 'info'; ?>
            <?php else: ?>
            <?php $type = 'warning'; ?>
            <?php endif; ?>
            <script type="text/javascript">
                $(document).ready(function(){
                    errFill();
                });
                <?php if ($msg['type'] == 'success'): ?>
                    showMessageTop('<?php echo $msg['msg']; ?>');
                <?php elseif ($msg['type'] == 'error'): ?>

                <?php endif; ?>
            </script>
        <?php endif; ?>

    <body class="login_bg">
        <div class="content">

            <h1 class="login_title"><span class="big"><a href="/site/index">中锦供应链</a></span> | 登录</h1>

        </div>
    <div class="login_content">
            <ul class="tab_name">
                <li class="lg active" id="login"><a href="/user/login"><i class="login_icon"></i>登录</a></li>
                <li class="rg " id="regist"><a href="/user/signup" ><i class="regist_icon"></i>注册</a></li>
            </ul>
            <div class="login_form_detail">
                <div class="lg_detail">
                    <form class="" action="/user/login" method="post">
                        <ul class="loginform">
                            <li><input type="tel"  autocomplete="off" name="mobile" value="<?php echo $mobile ?>" class="login_input" required placeholder="请输入账号/手机号"></li>
                            <li><input type="password" autocomplete="off" name="password" required value="<?php echo $password?>" class="login_input" placeholder="请输入密码"></li>
                            <a href="/user/resetpassword" class="gray_link">忘记密码</a>
                        </ul>
                            <?php if(isset($msg['msg'])):?>
                               <b style="color: #e53a33"> <?php echo $msg['msg']; ?></b>
                            <?php endif;?>
                        <input type="submit" value="登录" class="login_btn">
                    </form>

                </div>
                <div class="rg_detail hide">
                    <form  action='/user/signup' method="post">
                        <ul class="registform">
                            <li><input type="number" required name="mobile" class="login_input" placeholder="请输入手机号" autocomplete="off" id="phone_number"></li>
                            <li class="code"><input type="text" name="captcha" class="login_input" required autocomplete="off" placeholder="验证码"><input type="button" value="获取验证码" class="get_code" id="get_code" ></li>
                            <li><input type="password" class="login_input" name="password" required autocomplete="off" placeholder="请输入密码"></li>
                            <li class="check_agree"><label><input type="checkbox" id="is_agree">  我已认真阅读并同意</label>《<a href="" target="_blank">用户服务协议</a>》</li>
                        </ul>

                            <?php if(isset($msg['msg'])):?>
                               <b style="color: #e53a33"> <?php echo $msg['msg']; ?></b>
                            <?php endif;?>
                        <input type="submit" value="提交" class="login_btn" disabled="true">
                    </form>
                </div>
            </div>
        </div>
        <script src="/statics/plugins/jquery-1.7.2.min.js" charset="utf-8"></script>
        <script src="/statics/js/newCommon.js" charset="utf-8"></script>
        <script type="text/javascript">
            $(function(){
                $('#login').on('click',function(){
                    $(this).addClass('active');
                    $('#regist').removeClass('active');
                    $('.lg_detail').css('display','block');
                    $('.rg_detail').css('display','none');
                    $('.login_title').html(($('.login_title').html().replace('注册','登录')))
                });
                $('#regist').on('click',function(){
                    $(this).addClass('active');
                    $('#login').removeClass('active');
                    $('.rg_detail').css('display','block');
                    $('.lg_detail').css('display','none');
                    $('.login_title').html(($('.login_title').html().replace('登录','注册')))
                });

                //切换图片
                function loadImg(url) {
                    var oImg=new Image();
                    oImg.src=url;
                    oImg.onload=function () {
                        console.log(oImg);
                        $('.login_bg').css({
                            'background': 'url("'+oImg.getAttribute("src")+'") no-repeat center center fixed',
                            'background-size': 'over'
                        })
                    }
                }
                loadImg("/statics/image/login_bg.png")

            });
        </script>


    </body>
</html>
